﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcContrib.TestHelper;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace JaxDug.Test
{
    [TestClass]
    public class GlobalTests
    {
        [ClassInitialize]
        public static void Initialize(TestContext tc)
        {
            JaxDug.MvcApplication.RegisterRoutes(System.Web.Routing.RouteTable.Routes);
        }
        [TestMethod]
        public void RegisterRoutes_DefaultPage_MapsHome()
        {
            "~/".ShouldMapTo<JaxDug.Controllers.HomeController>(f=>f.Index());
        }

        [TestMethod]
        [ExpectedException(typeof(AssertionException))]
        public void RegisterRoutes_DefaultPage_FailsToRouteToAbout()
        {
            "~/".ShouldMapTo<JaxDug.Controllers.HomeController>(f => f.About());
        }

        //these tests aren't working yet
        //[TestMethod]
        public void RegisterRoutes_CodeCampDefault_MapsToCodeCampHome()
        {
            "~/codecamp/".ShouldMapTo<JaxDug.Areas.CodeCamp.Controllers.HomeController>(f => f.Index());
        }
        //[TestMethod]
        public void RegisterRoutes_CodeCampHome_MapsToCodeCampHome()
        {
            "~/codecamp/home".ShouldMapTo<JaxDug.Areas.CodeCamp.Controllers.HomeController>(f => f.Index());
        }
        //[TestMethod]
        public void RegisterRoutes_CodeCampHomeIndex_MapsToCodeCampHome()
        {
            "~/CodeCamp/Home/Index/".ShouldMapTo<JaxDug.Areas.CodeCamp.Controllers.HomeController>(f => f.Index());
        }
    }
}